<template>
  <div>

    <div class="list_tit decoration">
      <div class="list_left">{{ name }}</div>
      <div class="list_many" @click="() => $emit('clickMore')"><a href="javascript:void(0)">查看更多</a></div>
    </div>
    <dv-decoration-10 class="position" style="width:100%;height:3px;"/>
    <div class="list_box">
      <div class="list_item" v-for="item in data" @click="$emit('clickDetail', item)">
        <div class="item_img">
          <img :src="item.goods_img">
        </div>
        <div class="list_info">
          <div class="list_name txt-cut3">{{ item.goods_name }}</div>
          <div class="list_price">￥{{ item.goods_price }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    name: String,
    data: Array,
    id: String || Object || Array,
  }
}
</script>
<style scoped lang="less">
@import url('~@/assets/style/var.less');

.list_tit {
  width: 100%;
  height: 50px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  color: @txt-color;

  .list_left {
    font-weight: 700;
    font-size: 18px;
    line-height: 36px;
    color: #292929;
    color: @txt-color;
    border-bottom: 2px solid @border-color;
  }

}

.list_box {
  width: 100%;
  padding-top: 10px;
  padding-left: 50px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  margin-left: 25px;

  .list_item {
    width: calc(14% - 8px);
    background: #F7F9FA;
    border: 1px solid #F7F9FA;
    border-radius: 10px;
    margin: 0 33px 20px 0;
    padding: 19px 19px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    flex-direction: column;
    justify-content: flex-start;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    position: relative;

    .item_img {
      width: 133px;
      height: 133px;
      border-radius: 8px;

      /*
  div.list:nth-child(1)
   div:nth-child(2)
    div:nth-child(1)
     div:nth-child(1)
      img:nth-child(1)
   */

      img {
        width: 133px;
        height: 133px;
      }
    }

    .list_info {
      -webkit-box-flex: 3;
      -ms-flex: 3;
      flex: 3;
      padding-left: 15px;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: justify;
      -ms-flex-pack: justify;
      justify-content: space-between;
      -webkit-box-orient: vertical;
      -webkit-box-direction: normal;
      -ms-flex-direction: column;
      flex-direction: column;
    }

    .list_name {
      font-weight: 400;
      font-size: 14px;
      line-height: 25px;
      color: #292929;
      height: 45px;
      max-lines: 2;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  }
}

.decoration {
  position: relative;

  .position {
    position: absolute;
    left: 0;
    bottom: 0;
  }
}
</style>


